package org.spiniper.im.data.model.directive;

import java.util.UUID;

import org.spiniper.im.data.model.NoteMessage;
import org.spiniper.im.data.model.Users;
import org.spiniper.im.data.model.enums.NoteMsgType;

public abstract class AbstractDirective implements NoteMessage {
	private static final long serialVersionUID = 1L;

	private String id;
	
	private Users receiver;
	
	private Users sender;
	
	public AbstractDirective(){
		this.id=UUID.randomUUID().toString();
	}
	public AbstractDirective(String id){
		this.id=id;
	}
	
	public NoteMsgType getType() {
		return NoteMsgType.DIRECTIVE;
	}
	public String getId(){
		return this.id;
	}
	public Users getSender() {
		return sender;
	}
	public void setSender(Users sender) {
		this.sender = sender;
	}
	public void setReceiver(Users receiver) {
		this.receiver = receiver;
	}
	public Users getReceiver() {
		return receiver;
	}
	
	public abstract<E> void execute(E target) throws Exception;
}
